import { post } from '@/core/utils/http';
import type { Response } from '@/core/models';

/**  获取不同类型营销下单支持的配送方式 */
export const queryOrderDistributionModel = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/GetOrderDistributionModel', {
        data,
    }, true);
}

/**  获取全部订单列表 */
export const queryOrderList = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/GetOrderList', {
        data,
    }, true);
}

/**  根据订单编号获取当前订单的支付信息 */
export const queryOrderPayInfo = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/GetOrderPayInfo', {
        data,
    }, true);
}

/**  确认收货 */
export const queryOrderConfirm = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/OrderConfirm', {
        data,
    }, true);
}

/** 查询当前订单是否接入微信发货信息管理 */
export const queryOrderShippingList = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/OrderShippingList', {
        data,
    }, true);
}

/** 获取订单详情 */
export const queryOrderDetails = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/OrderDetails', {
        data,
    }, true);
}

/** 取消订单 */
export const queryCancelOrder = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/CancelOrder', {
        data,
    }, true);
}

/** 订单评价接口 */
export const submitOrderEvaluate = (data : any) : Promise<Response<any>> => {
    return post('Api/User/OrderEvaluate', {
        data,
    }, true);
}

/** 判断用户下单可以使用多少积分 */
export const queryUserPoint = (data : any) : Promise<Response<any>> => {
    return post('Api/User/GetUserPoint', {
        data,
    }, true);
}

/** 根据订单id取拼团信息，用在订单详情页 */
export const queryOrderPinTuanTeamInfo = (data : any) : Promise<Response<any>> => {
    return post('Api/PinTuan/GetPinTuanTeam', {
        data,
    }, true);
}

/** 获取发票是否开具 */
export const queryCheckInvoice = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/CheckInvoice', {
        data,
    }, true);
}

/** 提交发票申请 */
export const querySubmitInvoiceApply = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/SubmitInvoiceApply', {
        data,
    }, true);
}

/** 物流信息接口 */
export const queryLogisticsByApi = (data : any) : Promise<Response<any>> => {
    return post('Api/Order/LogisticsByApi', {
        data,
    }, true);
}